<template>
  <pageTabelLayout>
    <template #pageHeader>
      <div class="search-form divClass" v-if="headerShow">
        <div>
          <a-form size="small" :model="pageData" layout="inline">
            <a-form-item label="流转卡号">
              <a-select popup-container="html" :style="{ width: '180px' }" class="bacClass" :loading="loading"
                        :allowClear="true"
                        @search="handleSearch31" v-model="pageDataHold.transferCardNo" :filter-option="false"
                        allow-search
                        @focus="focusSel31">
                <a-option v-for="item in pageData.clothList3" :value="item['flowCardCode']">{{
                    item['flowCardCode']
                  }}
                </a-option>
              </a-select>
              <!-- <a-input allow-clear :style="{ width: '200px' }" class="bacClass" placeholder=""
                v-model="dataForm.transferCardNo1" @press-enter="huiche" /> -->
            </a-form-item>
            <a-form-item label="登记日期">
              <a-date-picker popup-container="html" :style="{ width: '180px' }" class="bacClass"
                             v-model="pageDataHold.startTime"/>
            </a-form-item>
            <a-form-item label="至">
              <a-date-picker popup-container="html" :style="{ width: '180px' }" class="bacClass"
                             v-model="pageDataHold.endTime"/>
            </a-form-item>
            <a-form-item label="布号">
              <a-select popup-container="html" :style="{ width: '180px' }" class="bacClass" :loading="loading"
                        :allowClear="true"
                        @search="handleSearchOP" v-model="pageDataHold.clothNo" :filter-option="false" allow-search
                        @focus="focusSelOP">
                <a-option v-for="item in pageData.clothList5" :value="item['clothCode']">{{
                    item['clothCode']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="布类">
              <a-select popup-container="html" :style="{ width: '180px' }" class="bacClass" :loading="loading"
                        :allowClear="true"
                        @search="handleSearchOP2" v-model="pageDataHold.clothClass" :filter-option="false" allow-search
                        @focus="focusSelOP2">
                <a-option v-for="item in pageData.clothList5" :value="item['brandName']">{{
                    item['brandName']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="坯布编号">
              <a-select popup-container="html" :style="{ width: '180px' }" class="bacClass" :loading="loading"
                        :allowClear="true"
                        @search="handleSearchOP3" v-model="pageDataHold.greyCode" :filter-option="false" allow-search
                        @focus="focusSelOP3">
                <a-option v-for="item in pageData.clothList5" :value="item['grayCode']">{{
                    item['grayCode']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
          </a-form>
        </div>
      </div>
      <div class="my-tool-bar" style="float:right">
        <Toolbar v-if="isIDs == 1" :items="['查询', '新增', '删除', '审核']" @add="addHandler" @del="deleteHandler"
                 @select="selectHandler" @audit="audits">
        </Toolbar>
        <Toolbar v-else :items="['查询', '反审']" @select="selectHandler1" @counter="counters">
        </Toolbar>
      </div>
      <div class="my-divisders">
        <a-divider orientation="center">
          <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18"/>
          <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18"/>
        </a-divider>
      </div>
    </template>
    <template #pageTabel>
      <!-- 主表 -->
      <a-tabs   :lazy-load="true" :justify="true" @change="changeTabs">
        <a-tab-pane title="待审核" :key="1">
          <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true"
                           rowSelection="multiple"
                           @grid-ready="gridReady" style="height: calc(100% - 45px)" :defaultColDef="defaultColDef"
                           class="ag-theme-alpine"
                           :rowData="table.dataList" :columnDefs="tc" :localeText="localeText1"></AgGridVuesCopys>
          <paginationCopys :page-size-options="pagingList1" v-if="isIDs == 1" :total="total" show-total show-jumper
                           show-page-size
                           @change="PageSize" @page-size-change="change1" style="justify-content: center"
                           :page-size="pagination.pageSize"
                           :current="pagination.page"/>
        </a-tab-pane>
        <a-tab-pane title="已审核" :key="2">
          <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true"
                           rowSelection="multiple"
                           @grid-ready="gridReady1" style="height: calc(100% - 45px)" :defaultColDef="defaultColDef1"
                           class="ag-theme-alpine"
                           :rowData="table.dataList" :columnDefs="dc" :localeText="localeText1"></AgGridVuesCopys>
          <paginationCopys :page-size-options="pagingList1" v-if="isIDs == 2" :total="total" show-total show-jumper
                           show-page-size
                           @change="PageSize" @page-size-change="change1" style="justify-content: center"
                           :page-size="pagination2.pageSize"
                           :current="pagination2.page"/>
        </a-tab-pane>
      </a-tabs>
    </template>
    <!-- 主表抽屉 -->
    <a-drawer :drawer-style="{ zIndex: 9999 }" :mask-closable="false" height="100%" :visible="pageData.showAdd"
              unmountOnClose @ok="sideOk" @cancel="pageData.showAdd = false" cancel-text="关闭" ok-text="保存"
              placement="bottom"
              :ok-loading="pageData.pageLoading">
      <template #title>
        {{ pageData.sideTitle }}
      </template>
      <div style="min-width: 1500px">
        <div>
          <a-form size="small" :model="pageData" layout="inline" label-align="right" :label-col-props="{ span: 4 }"
                  :wrapper-col-props="{ span: 16 }">
            <a-form-item label="记录单号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.recordNo" disabled></a-input>
            </a-form-item>
            <a-form-item label="流转卡号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch3"
                        v-model="dataForm.transferCardNo" :filter-option="false" allow-search @focus="focusSel3"
                        @change="changeNo1">
                <a-option v-for="item in pageData.clothList3" :value="item['flowCardCode']">{{
                    item['flowCardCode']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="登记日期" :style="{ width: '345px' }" label-col-flex="100px">
              <a-date-picker popup-container="html" class="bacClass" :style="{ width: '229px' }"
                             v-model="dataForm.registerDate"/>
            </a-form-item>
            <a-form-item label="布号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.clothNo" disabled></a-input>
            </a-form-item>
            <a-form-item label="品名" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.ingredient" disabled></a-input>
            </a-form-item>
            <a-form-item label="要求规格" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.askSpec"></a-input>
            </a-form-item>
            <a-form-item label="颜色" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.colorName"></a-input>
            </a-form-item>
            <a-form-item label="客户名称" :style="{ width: '345px' }" label-col-flex="100px">
              <!-- <a-select popup-container="html"  class="bacClass" :loading="loading" :allowClear="true" @search="handleSearch1"
                v-model="dataForm.clientName" :filter-option="false" allow-search @focus="focusSel1">
                <a-option v-for="item in pageData.clothList1" :value="item['customName']">{{
                  item['customName']
                }}</a-option>
              </a-select> -->
              <a-input class="bacClass" v-model="dataForm.clientName" disabled></a-input>
            </a-form-item>
            <a-form-item label="坯布规格" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.greySpec"></a-input>
            </a-form-item>
            <a-form-item label="干布机号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.dryerNo"></a-input>
            </a-form-item>
            <a-form-item label="染色机号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.dyeNo"></a-input>
            </a-form-item>
            <a-form-item label="开幅方式" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.scutchingWay"></a-input>
            </a-form-item>
            <a-form-item label="坯定条件" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.piDingCondition"></a-input>
            </a-form-item>
            <a-form-item label="开幅机号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.scutcherNo"></a-input>
            </a-form-item>
            <a-form-item label="布类" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.clothClass" disabled></a-input>
            </a-form-item>
            <a-form-item label="成品温度" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.productOC"></a-input-number>
            </a-form-item>
            <a-form-item label="坯布条件" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.piDingCondition"></a-input>
            </a-form-item>
            <a-form-item label="针架宽度" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.needleWidth"></a-input>
            </a-form-item>
            <a-form-item label="坯布名称" :style="{ width: '345px' }" label-col-flex="100px">
              <!-- <a-select popup-container="html"  class="bacClass" :loading="loading4" @search="selCxAll4" v-model="dataForm.greyName"
                :filter-option="false" allow-search @focus="selCxAll4('')" @change="changeNo4">
                <a-option v-for="item in options4" :value="item['grayFabricName']" :key="item['id']">{{ item['greyCode'] +
                  '——' + item['grayFabricName'] }}</a-option>
              </a-select> -->
              <a-input class="bacClass" v-model="dataForm.greyName" disabled></a-input>
            </a-form-item>
            <a-form-item label="坯布编号" :style="{ width: '345px' }" label-col-flex="100px">
              <!-- <a-select popup-container="html"  :loading="loading" :allowClear="true" @search="handleSearch4" v-model="dataForm.greyCode"
                :filter-option="false" allow-search @focus="focusSel4" @change="changeNo4">
                <a-option v-for="item in pageData.clothList4" :value="item['greyCode']">{{
                  item['greyCode']
                }}</a-option>
              </a-select> -->
              <a-input class="bacClass" v-model="dataForm.greyCode" disabled></a-input>
            </a-form-item>
            <a-form-item label="坯布批号" :style="{ width: '345px' }" label-col-flex="100px">
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch"
                        v-model="dataForm.greyBatch" :filter-option="false" allow-search @focus="focusSel">
                <a-option v-for="item in pageData.clothList" :value="item['classify']">{{
                    item['classify']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="坯定温度" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.piDingOC"></a-input>
            </a-form-item>
            <a-form-item label="干布温度" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.dryerOC"></a-input-number>
            </a-form-item>
            <a-form-item label="坯布缩水" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.greyShrink"></a-input>
            </a-form-item>
            <a-form-item label="下机规格" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.deplaneSpec"></a-input>
            </a-form-item>
            <a-form-item label="纱牌" :style="{ width: '345px' }" label-col-flex="100px">
              <!-- <a-select popup-container="html"  class="bacClass" :loading="loading" :allowClear="true" @search="handleSearch"
                v-model="dataForm.brandName" :filter-option="false" allow-search @focus="focusSel">
                <a-option v-for="item in pageData.clothList" :value="item['classify']">{{
                  item['classify']
                }}</a-option>
              </a-select> -->
              <a-input class="bacClass" v-model="dataForm.brandName"></a-input>
            </a-form-item>
            <a-form-item label="针寸数" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.needleSpeed"></a-input-number>
            </a-form-item>
            <a-form-item label="成品超喂" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input class="bacClass" v-model="dataForm.productChaowei"></a-input>
            </a-form-item>

            <a-form-item label="成品斜度" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.productSlope"></a-input-number>
            </a-form-item>
            <a-form-item label="洗后克重" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.washGram"></a-input-number>
            </a-form-item>

            <a-form-item label="收费项目" :style="{ width: '345px' }" label-col-flex="100px">
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch2"
                        v-model="dataForm.craftAsk" :filter-option="false" allow-search @focus="focusSel2">
                <a-option v-for="item in pageData.clothList2" :value="item['charges']">{{
                    item['charges']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="工艺单价" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.craftPrice"></a-input-number>
            </a-form-item>
            <a-form-item label="成品机速" :style="{ width: '345px' }" label-col-flex="100px">
              <a-input-number class="bacClass" v-model="dataForm.productSpeed"></a-input-number>
            </a-form-item>
            <a-form-item label="试样工艺流程" :style="{ width: '1200px' }" label-col-flex="100px">
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch5($event, 1)"
                        v-model="dataForm.sampleFlow" :filter-option="false" allow-search @focus="focusSel5(1)">
                <a-option v-for="item in pageData.clothList5" :value="item['flowName']">{{
                    item['flowName']
                  }}
                </a-option>
              </a-select>
            </a-form-item>
            <a-form-item label="大货参考流程" :style="{ width: '1200px' }" label-col-flex="100px">
              <a-select popup-container="html" class="bacClass" :loading="loading" :allowClear="true"
                        @search="handleSearch5($event, 2)"
                        v-model="dataForm.referToFlow" :filter-option="false" allow-search @focus="focusSel5(2)">
                <a-option v-for="item in pageData.clothList51" :value="item['flowName']">{{
                    item['flowName']
                  }}
                </a-option>
              </a-select>
              <!-- <a-input class="bacClass" v-model="dataForm.referToFlow" disabled></a-input> -->
            </a-form-item>
            <a-form-item label="备注" :style="{ width: '1200px' }" label-col-flex="100px">
              <a-textarea class="bacClass" v-model="dataForm.remark" :max-length="400" allow-clear show-word-limit/>
            </a-form-item>
          </a-form>
        </div>
      </div>
    </a-drawer>
    <div class="kkk"></div>
  </pageTabelLayout>
</template>

<script lang="ts">
import {post, get} from '@/api/http'
import {useTable, useRowKey, useTableColumn, usePagination, useRowSelection} from '@/hooks/table'
import {localeText} from '@/api/aggridZw'
import {ref, reactive, onMounted, onActivated, onUnmounted} from 'vue'
import Toolbar from '@/components/Toolbar.vue'
import {Form, Message, Modal, Pagination} from '@arco-design/web-vue'
import {FormInstance} from '@arco-design/web-vue/es/form'
import emitter from '@/hooks/useEventBus'
import validate from '@/hooks/useValidate'
import {baseURL} from '../../../../api/axios.config'
import axios from 'axios'
import filedownload from 'js-file-download'

import PageTabelLayout from '@/components/pageTabelLayout.vue'
import {addUserInfo} from '@/api/url'
import dayjs from 'dayjs'
import {pagingList} from "@/api/paging";

interface ClothSet {
  id: any
  serialNumber: number | undefined
  classify: string | undefined
  deleteState: any
  remark: string | undefined
  createName: string | undefined
  createTime: string | undefined
  updateName: string | undefined
  updateTime: string | undefined
  requireClassify: any
  optionx: any
  defaultx: any
  units: any
  requireClassifyID: any

  transferCardNo1: any
  recordNo: any
  transferCardNo: any
  registerDate: any
  registerDate1: any
  clothNo: any
  clothClass: any
  ingredient: any
  askSpec: any
  colorName: any
  clientName: any
  greySpec: any
  scutchingWay: any
  dryerNo: any
  dyeNo: any
  productOC: number | undefined
  piDingCondition: any
  scutcherNo: any
  needleWidth: any
  greyCode: any
  dryerOC: number | undefined
  jangfang: any
  greyBatch: any
  piDingOC: any
  productSpeed: number | undefined
  brandName: any
  greyShrink: any
  deplaneSpec: any
  needleSpeed: number | undefined
  productChaowei: any
  sampleFlow: any
  referToFlow: any
  craftAsk: any
  productSlope: number | undefined
  washGram: number | undefined
  craftPrice: number | undefined
  greyName: any
}

export default {
  name: 'DevelopSampleRegistrationListDemo',
  setup() {
    const dataForm = reactive<ClothSet>({
      id: null,
      serialNumber: 0,
      createTime: '',
      classify: '',
      remark: '',
      updateTime: '',
      updateName: '',
      createName: '',
      deleteState: 0,
      requireClassify: '',
      optionx: '',
      defaultx: '',
      units: '',
      requireClassifyID: '',

      transferCardNo1: '',
      recordNo: '',
      transferCardNo: '',
      registerDate: '',
      registerDate1: '',
      clothNo: '',
      clothClass: '',
      ingredient: '',
      askSpec: '',
      colorName: '',
      clientName: '',
      greySpec: '',
      scutchingWay: '',
      dryerNo: '',
      dyeNo: '',
      productOC: 0,
      piDingCondition: '',
      scutcherNo: '',
      needleWidth: '',
      greyCode: '',
      dryerOC: 0,
      jangfang: '',
      greyBatch: '',
      piDingOC: '',
      productSpeed: 0,
      brandName: '',
      greyShrink: '',
      deplaneSpec: '',
      needleSpeed: 0,
      productChaowei: '',
      sampleFlow: '',
      referToFlow: '',
      craftAsk: '',
      productSlope: 0,
      washGram: 0,
      craftPrice: 0,
      greyName: '',
    })

    const headerShow = ref<boolean>(true)
    // 未审核查询
    const scrollbar = ref(true)

    function doRefresh() {


      post({
        url: 'pdm/devSampleRegister/getPage',
        data: {
          page: pagination.page,
          size: pagination.pageSize,
          transferCardNo: pageDataHold.transferCardNo,
          clothNo: pageDataHold.clothNo,
          clothClass: pageDataHold.clothClass,
          greyCode: pageDataHold.greyCode,
          startTime: pageDataHold.startTime,
          endTime: pageDataHold.endTime,
          auditState: 0,
          deleteState: 0,
        },
      })
          .then(({data, code}: any) => {
            if (code === 200) {
              table.handleSuccess(data.list)
              gridOption.value.setRowData(data.list)
              total.value = data.total
            }
          })
          .catch(console.log)
          .finally(() => {
            pageData.pageLoading = false
          })
    }

    // 已审核查询
    function doRefresh1() {
      pageData.pageLoading = true

      post({
        url: 'pdm/devSampleRegister/getPage',
        data: {
          auditState: 1,
          deleteState: 0,
          page: pagination.page,
          size: pagination.pageSize,
          transferCardNo: pageDataHold.transferCardNo,
          clothNo: pageDataHold.clothNo,
          clothClass: pageDataHold.clothClass,
          greyCode: pageDataHold.greyCode,
          startTime: pageDataHold.startTime,
          endTime: pageDataHold.endTime,
        },
      })
          .then(({data, code}: any) => {
            if (code === 200) {
              table.handleSuccess(data.list)
              gridOption1.value.setRowData(data.list)
              total.value = data.total
            }
          })
          .catch(console.log)
          .finally(() => {
            pageData.pageLoading = false
          })
    }

    const {selectedRowKeys, onSelectionChange} = useRowSelection()
    const pagination = usePagination(doRefresh)
    const pagination2 = usePagination(doRefresh)
    const table = useTable()
    const rowKey = useRowKey('id')
    //检验表单是否含有中文的方法
    const hasChiese = validate.includeChinese
    const tableColumns = useTableColumn([
      {
        title: '记录单号',
        key: 'recordNo',
        dataIndex: 'recordNo',
        width: 150,
      },
      {
        title: '流转卡号',
        key: 'transferCardNo',
        dataIndex: 'transferCardNo',
        width: 150,
      },
      {
        title: '登记日期',
        key: 'registerDate',
        dataIndex: 'registerDate',
        width: 150,
      },
      {
        title: '布号',
        key: 'clothNo',
        dataIndex: 'clothNo',
        width: 150,
      },
      {
        title: '布类',
        key: 'clothClass',
        dataIndex: 'clothClass',
        width: 150,
      },
      {
        title: '成分',
        key: 'ingredient',
        dataIndex: 'ingredient',
        width: 150,
      },
      {
        title: '要求规格',
        key: 'askSpec',
        dataIndex: 'askSpec',
        width: 150,
      },
      {
        title: '颜色',
        key: 'colorName',
        dataIndex: 'colorName',
        width: 150,
      },
      {
        title: '客户名称',
        key: 'clientName',
        dataIndex: 'clientName',
        width: 150,
      },
      {
        title: '坯布规格',
        key: 'greySpec',
        dataIndex: 'greySpec',
        width: 150,
      },
      {
        title: '开幅方式',
        key: 'scutchingWay',
        dataIndex: 'scutchingWay',
        width: 150,
      },
      {
        title: '干布机号',
        key: 'dryerNo',
        dataIndex: 'dryerNo',
        width: 150,
      },
      {
        title: '染色机号',
        key: 'dyeNo',
        dataIndex: 'dyeNo',
        width: 150,
      },
      {
        title: '成品温度',
        key: 'productOC',
        dataIndex: 'productOC',
        width: 150,
      },
      {
        title: '坯定条件',
        key: 'piDingCondition',
        dataIndex: 'piDingCondition',
        width: 150,
      },
      {
        title: '开幅机号',
        key: 'scutcherNo',
        dataIndex: 'scutcherNo',
        width: 150,
      },
      {
        title: '针架宽度',
        key: 'needleWidth',
        dataIndex: 'needleWidth',
        width: 150,
      },
      {
        title: '坯布编号',
        key: 'greyCode',
        dataIndex: 'greyCode',
        width: 150,
      },
      {
        title: '坯布名称',
        key: 'greyName',
        dataIndex: 'greyName',
        width: 150,
      },
      {
        title: '干布温度',
        key: 'dryerOC',
        dataIndex: 'dryerOC',
        width: 150,
      },
      {
        title: '浆方',
        key: 'jangfang',
        dataIndex: 'jangfang',
        width: 150,
      },
      {
        title: '坯布批号',
        key: 'greyBatch',
        dataIndex: 'greyBatch',
        width: 150,
      },
      {
        title: '坯定温度',
        key: 'piDingOC',
        dataIndex: 'piDingOC',
        width: 150,
      },
      {
        title: '成品机速',
        key: 'productSpeed',
        dataIndex: 'productSpeed',
        width: 150,
      },
      {
        title: '纱牌',
        key: 'brandName',
        dataIndex: 'brandName',
        width: 150,
      },
      {
        title: '坯布缩水',
        key: 'greyShrink',
        dataIndex: 'greyShrink',
        width: 150,
      },
      {
        title: '下机规格',
        key: 'deplaneSpec',
        dataIndex: 'deplaneSpec',
        width: 150,
      },
      {
        title: '针时速',
        key: 'needleSpeed',
        dataIndex: 'needleSpeed',
        width: 150,
      },
      {
        title: '成品超喂',
        key: 'productChaowei',
        dataIndex: 'productChaowei',
        width: 150,
      },
      {
        title: '试样工艺流程',
        key: 'sampleFlow',
        dataIndex: 'sampleFlow',
        width: 150,
      },
      {
        title: '大货参考流程',
        key: 'referToFlow',
        dataIndex: 'referToFlow',
        width: 150,
      },
      {
        title: '工艺要求（收费项目）',
        key: 'craftAsk',
        dataIndex: 'craftAsk',
        width: 150,
      },
      {
        title: '成品斜度',
        key: 'productSlope',
        dataIndex: 'productSlope',
        width: 150,
      },
      {
        title: '洗后克重',
        key: 'washGram',
        dataIndex: 'washGram',
        width: 150,
      },
      {
        title: '工艺单价',
        key: 'craftPrice',
        dataIndex: 'craftPrice',
        width: 150,
      },
      {
        title: '备注',
        key: 'remark',
        dataIndex: 'remark',
        width: 150,
      },
      {
        title: '创建人',
        key: 'createName',
        dataIndex: 'createName',
        width: 150,
      },
      {
        title: '创建时间',
        key: 'createTime',
        dataIndex: 'createTime',
        width: 150,
      },
      {
        title: '最后修改人',
        key: 'updateName',
        dataIndex: 'updateName',
        width: 150,
      },
      {
        title: '最后修改时间',
        key: 'updateTime',
        dataIndex: 'updateTime',
        width: 150,
      },
      {
        title: '状态',
        key: 'auditState',
        dataIndex: 'auditState',
        slotName: 'act2',
        width: 150,
        fixed: 'right',
      },
      {
        title: '操作',
        key: 'id',
        dataIndex: 'id',
        slotName: 'act',
        width: 150,
        fixed: 'right',
      },
    ])
    const tableColumns1 = useTableColumn([
      {
        title: '记录单号',
        key: 'recordNo',
        dataIndex: 'recordNo',
        width: 150,
      },
      {
        title: '流转卡号',
        key: 'transferCardNo',
        dataIndex: 'transferCardNo',
        width: 150,
      },
      {
        title: '登记日期',
        key: 'registerDate',
        dataIndex: 'registerDate',
        width: 150,
      },
      {
        title: '布号',
        key: 'clothNo',
        dataIndex: 'clothNo',
        width: 150,
      },
      {
        title: '布类',
        key: 'clothClass',
        dataIndex: 'clothClass',
        width: 150,
      },
      {
        title: '成分',
        key: 'ingredient',
        dataIndex: 'ingredient',
        width: 150,
      },
      {
        title: '要求规格',
        key: 'askSpec',
        dataIndex: 'askSpec',
        width: 150,
      },
      {
        title: '颜色',
        key: 'colorName',
        dataIndex: 'colorName',
        width: 150,
      },
      {
        title: '客户名称',
        key: 'clientName',
        dataIndex: 'clientName',
        width: 150,
      },
      {
        title: '坯布规格',
        key: 'greySpec',
        dataIndex: 'greySpec',
        width: 150,
      },
      {
        title: '开幅方式',
        key: 'scutchingWay',
        dataIndex: 'scutchingWay',
        width: 150,
      },
      {
        title: '干布机号',
        key: 'dryerNo',
        dataIndex: 'dryerNo',
        width: 150,
      },
      {
        title: '染色机号',
        key: 'dyeNo',
        dataIndex: 'dyeNo',
        width: 150,
      },
      {
        title: '成品温度',
        key: 'productOC',
        dataIndex: 'productOC',
        width: 150,
      },
      {
        title: '坯定条件',
        key: 'piDingCondition',
        dataIndex: 'piDingCondition',
        width: 150,
      },
      {
        title: '开幅机号',
        key: 'scutcherNo',
        dataIndex: 'scutcherNo',
        width: 150,
      },
      {
        title: '针架宽度',
        key: 'needleWidth',
        dataIndex: 'needleWidth',
        width: 150,
      },
      {
        title: '坯布编号',
        key: 'greyCode',
        dataIndex: 'greyCode',
        width: 150,
      },
      {
        title: '坯布名称',
        key: 'greyName',
        dataIndex: 'greyName',
        width: 150,
      },
      {
        title: '干布温度',
        key: 'dryerOC',
        dataIndex: 'dryerOC',
        width: 150,
      },
      {
        title: '浆方',
        key: 'jangfang',
        dataIndex: 'jangfang',
        width: 150,
      },
      {
        title: '坯布批号',
        key: 'greyBatch',
        dataIndex: 'greyBatch',
        width: 150,
      },
      {
        title: '坯定温度',
        key: 'piDingOC',
        dataIndex: 'piDingOC',
        width: 150,
      },
      {
        title: '成品机速',
        key: 'productSpeed',
        dataIndex: 'productSpeed',
        width: 150,
      },
      {
        title: '纱牌',
        key: 'brandName',
        dataIndex: 'brandName',
        width: 150,
      },
      {
        title: '坯布缩水',
        key: 'greyShrink',
        dataIndex: 'greyShrink',
        width: 150,
      },
      {
        title: '下机规格',
        key: 'deplaneSpec',
        dataIndex: 'deplaneSpec',
        width: 150,
      },
      {
        title: '针时速',
        key: 'needleSpeed',
        dataIndex: 'needleSpeed',
        width: 150,
      },
      {
        title: '成品超喂',
        key: 'productChaowei',
        dataIndex: 'productChaowei',
        width: 150,
      },
      {
        title: '试样工艺流程',
        key: 'sampleFlow',
        dataIndex: 'sampleFlow',
        width: 150,
      },
      {
        title: '大货参考流程',
        key: 'referToFlow',
        dataIndex: 'referToFlow',
        width: 150,
      },
      {
        title: '工艺要求（收费项目）',
        key: 'craftAsk',
        dataIndex: 'craftAsk',
        width: 150,
      },
      {
        title: '成品斜度',
        key: 'productSlope',
        dataIndex: 'productSlope',
        width: 150,
      },
      {
        title: '洗后克重',
        key: 'washGram',
        dataIndex: 'washGram',
        width: 150,
      },
      {
        title: '工艺单价',
        key: 'craftPrice',
        dataIndex: 'craftPrice',
        width: 150,
      },
      {
        title: '备注',
        key: 'remark',
        dataIndex: 'remark',
        width: 150,
      },
      {
        title: '创建人',
        key: 'createName',
        dataIndex: 'createName',
        width: 150,
      },
      {
        title: '创建时间',
        key: 'createTime',
        dataIndex: 'createTime',
        width: 150,
      },
      {
        title: '最后修改人',
        key: 'updateName',
        dataIndex: 'updateName',
        width: 150,
      },
      {
        title: '最后修改时间',
        key: 'updateTime',
        dataIndex: 'updateTime',
        width: 150,
      },

      {
        title: '状态',
        key: 'auditState',
        dataIndex: 'auditState',
        slotName: 'act1',
        width: 150,
        fixed: 'right',
      },
    ])
    const scroll = {
      x: 2000,
      y: 200,
    }
    const tablediv = ref(null)
    const pageData = reactive<{
      clothList: ClothSet[]
      clothList1: ClothSet[]
      clothList2: ClothSet[]
      clothList3: ClothSet[]
      clothList4: ClothSet[]
      clothList5: ClothSet[]
      clothList6: ClothSet[]
      showAdd: boolean
      showAdd1: boolean
      sideTitle: string
      sideTitle1: string
      dropDownData: any
      pageLoading: boolean
      theight: number
      tablediv: any
      rHeight: number | undefined
      dutymachineState: number | undefined
      flowCardCode: any
      customName: any
      charges: any
      clothList51: any[]
    }>({
      clothList51: [],
      clothList: [],
      clothList1: [],
      clothList2: [],
      clothList3: [],
      clothList4: [],
      clothList5: [],
      clothList6: [],
      sideTitle1: '新增默认值',
      showAdd: false,
      showAdd1: false,
      sideTitle: '新增开发试样',
      dropDownData: '',
      pageLoading: false,
      theight: 0,
      tablediv: null,
      rHeight: 0,
      dutymachineState: 0,
      flowCardCode: '',
      customName: '',
      charges: '',
    })
    const pageDataHold = reactive<{
      clothNo: any
      clothClass: any
      greyCode: any
      startTime: any
      endTime: any
      transferCardNo: any
    }>({
      clothNo: '',
      clothClass: '',
      greyCode: '',
      startTime: '',
      endTime: '',
      transferCardNo: ''
    })
    //下拉框得到焦点
    const focusSel = () => {
      selCxAll({classify: ''})
    }
    //下拉数据
    const options = ref<any>(pageData.clothList)
    const loading = ref(false)
    const handleSearch = (value: any) => {
      if (value) {
        const ob = {classify: value}
        loading.value = true
        selCxAll(ob)
        options.value = pageData.clothList
        loading.value = false
      } else {
        options.value = []
      }
    }

    //下拉框查询
    function selCxAll(val: any) {
      post({
        url: 'pdm/RequireClassify/getFieldValue',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    onMounted(() => {
      // 第一个页面需要在刚进入就调用一次  切换tap时也需要调用
      // doRefresh();
      // selCxAll({});
      // 切换tap到本页面执行的方法
      // emitter.on("DevelopSampleRegistrationListDemo", () => {
      //     // selCxAll({});
      //     doRefresh();
      // });
      pageData2.rHeight = document.getElementsByClassName('main-section')[0]?.clientHeight
      //弹出层的高
      if (pageData2.rHeight !== undefined) {
        pageData2.rHeight = pageData2.rHeight - 100
      }
    })
    let cxbl = ''
    // 未审核分页查询
    const selectHandler = () => {
      pagination.page = 1
      // cxbl = pageData.dropDownData
      if (pageData.dropDownData !== '') {
        doRefresh()
      } else {
        doRefresh()
      }
    }
    // 已审核分页查询
    const selectHandler1 = () => {
      pagination.page = 1
      // cxbl = pageData.dropDownData
      if (pageData.dropDownData !== '') {
        doRefresh1()
      } else {
        doRefresh1()
      }
    }
    const queryData = reactive({
      clothType: '',
    })
    const addHandler = () => {
      for (var key in dataForm) {
        dataForm[key] = undefined
      }
      // 显示当前日期
      dataForm.registerDate = dayjs().format('YYYY-MM-DD')
      pageData.showAdd = true
      pageData.sideTitle = '新增开发试样'
    }
    const addHandler1 = () => {
      for (var key in dataForm) {
        if (key === 'id') {
          dataForm[key] = null
        } else {
          dataForm[key] = ''
        }
      }
      pageData.showAdd1 = true
      pageData.sideTitle1 = '新增默认值'
    }

    // 新增
    const formRef = ref<FormInstance>()
    const sideOk = () => {
      // formRef.value?.validate().then((err) => {
      // if (!err) {
      pageData.pageLoading = true
      if (pageData.sideTitle === '新增开发试样') {
        post({
          url: 'pdm/devSampleRegister/add',
          data: [dataForm],
        }).then((res: any) => {
          if (res.code === 200) {
            formRef.value?.resetFields()

            pageData.showAdd = false

            Message.success({
              content: '新增成功',
              duration: 5000,
            })
            pageData.pageLoading = false
            doRefresh()
          } else {
            Message.error({
              content: res.message,
              duration: 5000,
            })
          }
        })
      } else {
        gridOption.value.getSelectedRows().map((item: any) => {
          return (dataForm.id = item.id)
        })
        post({
          url: '/pdm/devSampleRegister/updateSamp',
          data: [dataForm],
        }).then((res: any) => {
          if (res.code === 200) {
            formRef.value?.resetFields()
            pageData.showAdd = false
            pageData.pageLoading = false
            Message.success({
              content: '修改成功',
              duration: 5000,
            })
            doRefresh()
          } else {
            Message.error({
              content: res.message,
              duration: 5000,
            })
          }
        }).finally(() => {
          pageData.pageLoading = false
        })
      }
      // }
      // });
    }
    // 未审核页面审核方法
    const audits = () => {
      if (gridOption.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return
      }
      Modal.confirm({
        title: '系统提示',
        content: '是否审核此订单',
        onOk() {
          post({
            url: '/pdm/devSampleRegister/setAudit',
            // data: auditStateId,
            data: gridOption.value.getSelectedRows().map((item: any) => {
              return {id: item.id, auditState: 1}
            }),
          }).then((res: any) => {
            if (res.code === 200) {
              doRefresh()
              Message.success('审核通过')
              // selectedRowKeys.value = []
            } else {
              Message.error(res.message)
            }
          })
        },
      })
    }
    // 已经审核页面反审方法
    const counters = () => {
      if (gridOption1.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return
      }
      Modal.confirm({
        title: '系统提示',
        content: '是否审核此订单',
        onOk() {
          post({
            url: '/pdm/devSampleRegister/setAudit',
            // data: auditStateId,
            data: gridOption1.value.getSelectedRows().map((item: any) => {
              return {id: item.id, auditState: 0}
            }),
          }).then((res: any) => {
            if (res.code === 200) {
              doRefresh1()
              Message.success('审核通过')
              // selectedRowKeys.value = []
            } else {
              Message.error(res.message)
            }
          })
        },
      })
    }

    const deleteHandler = () => {
      if (gridOption.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return
      }
      Modal.confirm({
        title: '系统提示',
        content: '确认删除选中的数据?',
        onOk() {
          post({
            url: 'pdm/devSampleRegister/delete',
            data: gridOption.value.getSelectedRows().map((o: any) => {
              return o.id
            }),
          }).then(({code, data, message}: any) => {
            if (code === 200) {
              Message.success({
                content: '删除成功',
                duration: 5000,
              })

              pagination.page = 1
              doRefresh()
            } else {
              Message.error({
                content: '删除失败',
                duration: 5000,
              })
            }
          })
        },
      })
    }

    const editHandler = (record: ClothSet) => {
      for (var key in record) {
        dataForm[key] = record[key]
      }
      pageData.sideTitle = '修改开发试样'
      pageData.showAdd = true
    }

    const pageData2 = reactive<{
      showAdd: boolean
      rHeight: any
    }>({
      showAdd: false,
      rHeight: 0,
    })

    let lengsDs: number = 0
    // 表格准备事件
    const gridOption = ref()
    const gridReady = (params: any) => {
      gridOption.value = params.api
    }
    const defaultColDef = {
      sortable: true,
      resizable: true,
      filter: true,
      // flex: 1
    }
    let tc: any[] = tableColumns.map((o) => {
      let obj = {
        headerName: o.title,
        field: o.key,
        pinned: o['fixed'],
      }
      if (o.slotName === 'act') {
        obj['resizable'] = false
        obj['filter'] = false
        obj['sortable'] = false
        obj['lockPosition'] = 'right'
        obj['width'] = 130
        obj['cellRenderer'] = {
          template: `
            <a-space>
              <el-button style="color:#165dff;" @click="a" class="gesture" link>修改</el-button>
            </a-space>`,
          setup(props: any) {
            const a = () => {
              editHandler(props.params.data)
            }
            return {
              a,
              ainfo: props.params.data,
            }
          },
        }
      }
      if (o.slotName === 'act2') {
        obj['resizable'] = false
        obj['filter'] = false
        obj['sortable'] = false
        obj['lockPosition'] = 'right'
        obj['width'] = 130
        obj['cellRenderer'] = {
          template: `
            <a-space>
              <el-tag type="warning" class="gesture">{{ ainfo.auditState == 0 ? '待审核' : "已审核" }}</el-tag>
            </a-space>`,
          setup(props: any) {
            const a = () => {
              editHandler(props.params.data)
            }
            return {
              a,
              ainfo: props.params.data,
            }
          },
        }
      }

      return obj
    })
    // 表格准备事件
    const gridOption1 = ref()
    const gridReady1 = (params: any) => {
      gridOption1.value = params.api
    }
    const defaultColDef1 = {
      sortable: true,
      resizable: true,
      filter: true,
      // flex: 1
    }
    let dc: any[] = tableColumns1.map((o) => {
      let obj = {
        headerName: o.title,
        field: o.key,
        pinned: o['fixed'],
      }
      if (o.slotName === 'act1') {
        obj['resizable'] = false
        obj['filter'] = false
        obj['sortable'] = false
        obj['lockPosition'] = 'right'
        obj['width'] = 100
        obj['cellRenderer'] = {
          template: `
            <el-tag type="success" class="gesture">{{ ainfo.auditState == 0 ? '待审核' : "已审核" }}</el-tag>`,
          setup(props: any) {
            return {
              ainfo: props.params.data,
            }
          },
        }
      }
      return obj
    })
    let a = [
      {
        showRowGroup: 'hide_def',
        headerName: '',
        checkboxSelection: true,
        headerCheckboxSelection: true,
        pinned: 'left',
        width: 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: 'left',
      },
    ]
    tc = a.concat(tc)
    dc = a.concat(dc)
    const total = ref(10)
    const page = ref(1)
    const size = ref(10)
    let isIDs: any = ref(1)
    let id = ref(1)

    function PageSize(val: any) {
      if (isIDs.value == 1) {
        pagination.page = val
        doRefresh()
      } else if (id.value == 2) {
        pagination2.page = val
        doRefresh1()
      }
    }

    function change1(val: any) {
      if (isIDs.value == 1) {
        pagination.pageSize = val
        doRefresh()
      } else {
        pagination2.pageSize = val
        doRefresh1()
      }
    }

    const checkeded = ref<boolean>()
    const localeText1: any = ref(localeText)

    //已处理 未处理tab切换
    const changeTabs = (val: any) => {
      isIDs.value = val
      if (isIDs.value == 1) {
        pageData.dutymachineState = 0
        doRefresh()
      } else {
        pageData.dutymachineState = 1
        doRefresh1()
      }
    }

    //客户名称下拉框得到焦点
    const focusSel1 = () => {
      selCxAll1({customName: ''})
    }
    //客户名称下拉数据
    const options1 = ref<any>(pageData.clothList1)
    const loading1 = ref(false)
    const handleSearch1 = (value: any) => {
      if (value) {
        const ob = {customName: value}
        loading1.value = true
        selCxAll1(ob)
        options1.value = pageData.clothList1
        loading1.value = false
      } else {
        options1.value = []
      }
    }

    //客户名称下拉框查询
    function selCxAll1(val: any) {
      post({
        url: '/aps/custom/getDropValue',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList1 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    //收费项目下拉框得到焦点
    const focusSel2 = () => {
      selCxAll2({charges: ''})
    }
    //收费项目下拉数据
    const options2 = ref<any>(pageData.clothList2)
    const loading2 = ref(false)
    const handleSearch2 = (value: any) => {
      if (value) {
        const ob = {charges: value}
        loading2.value = true
        selCxAll2(ob)
        options2.value = pageData.clothList2
        loading2.value = false
      } else {
        options2.value = []
      }
    }

    //收费项目下拉框查询
    function selCxAll2(val: any) {
      post({
        url: '/pdm/chargeProject/getFieldValue',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList2 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    // function changeNo2(val: any) {
    //     post({
    //         url: "/pdm/chargeProject/getList",
    //         data: { "charges": val }
    //     }).then(({ data, code }: any) => {
    //         if (code === 200) {
    //             dataForm.craftPrice = data[0].greyName;

    //         } else {
    //             Message.error({
    //                 content: "查询失败！",
    //                 duration: 5000,
    //             });
    //         }
    //     });
    // }

    //新增-卡号下拉框得到焦点
    const focusSel3 = () => {
      selCxAll3({flowCardCode: ''})
    }
    //新增-卡号下拉数据
    const options3 = ref<any>(pageData.clothList3)
    const loading3 = ref(false)
    const handleSearch3 = (value: any) => {
      if (value) {
        const ob = {flowCardCode: value}
        loading3.value = true
        selCxAll3(ob)
        options3.value = pageData.clothList3
        loading3.value = false
      } else {
        options3.value = []
      }
    }

    //新增-流转卡号下拉框查询
    function selCxAll3(val: any) {
      post({
        url: '/aps/circulatCard/getDropValue',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList3 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    function changeNo1(val: any) {
      post({
        url: '/aps/circulatCard/getInfoByCodeSam',
        data: {flowCardCode: val},
      }).then(({data, code}: any) => {
        if (code === 200) {
          dataForm.clothNo = data[0].clothCode
          dataForm.clientName = data[0].customName
          dataForm.greyCode = data[0].greyCode
          dataForm.ingredient = data[0].productName
          dataForm.colorName = data[0].colorCode
          dataForm.clothClass = data[0].clothType
          dataForm.needleSpeed = data[0].needleDim

          dataForm.sampleFlow = data[0].produceFlowName
          dataForm.greyName = data[0].greyName
          dataForm.greyBatch = data[0].batch
          dataForm.brandName = data[0].yarnCard
          // dataForm.referToFlow = data[0].produceFlowSort
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    //查询-流转卡号下拉框得到焦点
    const focusSel31 = () => {
      selCxAll31({flowCardCode: ''})
    }
    //查询-流转卡号下拉数据
    const options31 = ref<any>(pageData.clothList3)
    const loading31 = ref(false)
    const handleSearch31 = (value: any) => {
      if (value) {
        const ob = {flowCardCode: value}
        loading31.value = true
        selCxAll31(ob)
        options31.value = pageData.clothList3
        loading31.value = false
      } else {
        options31.value = []
      }
    }

    //查询-流转卡号下拉框查询
    function selCxAll31(val: any) {
      post({
        url: '/aps/circulatCard/getDropValue',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList3 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    // function changeNo11(val: any) {
    //     post({
    //         url: "/aps/circulatCard/getList",
    //         data: { "flowCardCode": val }
    //     }).then(({ data, code }: any) => {
    //         if (code === 200) {
    //             dataForm.clothNo = data[0].clothNo;
    //             dataForm.clientName = data[0].customName;
    //             dataForm.greyCode = data[0].clothCode;
    //             dataForm.greyName = data[0].greyName;
    //             dataForm.greyBatch = data[0].greyBatch;
    //             dataForm.referToFlow = data[0].productionProcess;

    //         } else {
    //             Message.error({
    //                 content: "查询失败！",
    //                 duration: 5000,
    //             });
    //         }
    //     });
    // }

    //坯布编号下拉框得到焦点
    const focusSel4 = () => {
      selCxAll4({greyCode: ''})
    }
    //坯布编号下拉数据
    const options4 = ref<any>([])
    const loading4 = ref(false)
    const handleSearch4 = (value: any) => {
      selCxAll4({greyCode: value})
    }

    //坯布编号下拉框查询
    function selCxAll4(value: any) {
      loading4.value = true
      post({
        url: 'pdm/GreyInformation/getFieldValue1',
        data: value,
      }).then(({data, code, message}: any) => {
        loading4.value = false
        if (code == 200) {
          pageData.clothList4 = data
        } else {
          Message.error({
            content: message,
            duration: 5000,
          })
        }
      })
    }

    function changeNo4(val: any) {
      let list = options4.value.filter((item: { grayFabricName: string }) => {
        return item.grayFabricName == val
      })
      dataForm.greyCode = list[0]['greyCode']
    }

    //式样工艺流程下拉框得到焦点
    const focusSel5 = (val: any) => {
      if (val == 1) {
        selCxAll5({flowName: ''})
      } else if (val == 2) {
        selCxAll51({flowName: ''})
      }
    }
    //式样工艺流程下拉数据
    const options5 = ref<any>(pageData.clothList5)
    const loading5 = ref(false)
    const handleSearch5 = (value: any, item: any) => {
      if (item == 1) {
        if (value) {
          const ob = {flowName: value}
          loading5.value = true
          selCxAll5(ob)
          options5.value = pageData.clothList5
          loading5.value = false
        } else {
          options5.value = []
        }
      } else if (item == 2) {
        const ob = {flowName: value}
        selCxAll51(ob)
      }

    }

    //式样工艺流程下拉框查询
    function selCxAll5(val: any) {
      post({
        url: '/pdm/ProductProcess/getFieldValue1',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList5 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    function selCxAll51(val: any) {
      post({
        url: '/pdm/ProductProcess/getFieldValue1',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList51 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    const huiche = () => {
      if (isIDs.value == 1) {
        doRefresh()
      } else {
        doRefresh1()
      }
    }
    const pagingList1: any = ref(pagingList)
    const focusSelOP = () => {
      selCxAllOP({clothCode: ''})
    }
    const handleSearchOP = (value: any) => {
      if (value) {
        const ob = {clothCode: value}
        selCxAllOP(ob)
      }
    }
    const focusSelOP2 = () => {
      selCxAllOP({brandName: ''})
    }
    const handleSearchOP2 = (value: any) => {
      if (value) {
        const ob = {brandName: value}
        selCxAllOP(ob)
      }
    }
    const focusSelOP3 = () => {
      selCxAllOP({grayCode: ''})
    }
    const handleSearchOP3 = (value: any) => {
      if (value) {
        const ob = {grayCode: value}
        selCxAllOP(ob)
      }
    }

    function selCxAllOP(val: any) {
      post({
        url: 'pdm/DevFabricInfo/getFieldValue2',
        data: val,
      }).then(({data, code}: any) => {
        if (code === 200) {
          pageData.clothList5 = data
        } else {
          Message.error({
            content: '查询失败！',
            duration: 5000,
          })
        }
      })
    }

    return {
      pagingList1,
      huiche,
      // changeNo2,
      handleSearch5,
      focusSel5,
      changeNo4,
      handleSearch4,
      focusSel4,
      changeNo1,
      handleSearch2,
      focusSel2,
      handleSearch3,
      focusSel3,
      handleSearch31,
      focusSel31,
      // changeNo11,
      handleSearch1,
      focusSel1,
      counters,
      doRefresh1,
      selectHandler1,
      audits,
      isIDs,
      changeTabs,
      localeText1,
      checkeded,
      gridReady1,
      defaultColDef1,
      dc,
      tableColumns1,
      PageSize,
      change1,
      total,
      tc,
      defaultColDef,
      gridReady,
      scroll,
      scrollbar,
      tablediv,
      hasChiese,
      deleteHandler,
      sideOk,
      formRef,
      dataForm,
      addHandler,
      addHandler1,
      selectedRowKeys,
      pagination,
      pagination2,
      tableColumns,
      table,
      rowKey,
      pageData,
      queryData,
      editHandler,
      selectHandler,
      options,
      loading,
      handleSearch,
      focusSel,
      headerShow,
      pageData2,
      selCxAll4,
      loading4,
      options4,
      pageDataHold,
      handleSearchOP,
      handleSearchOP2,
      handleSearchOP3,
      focusSelOP,
      focusSelOP2,
      focusSelOP3,
    }
  },
  components: {Toolbar, PageTabelLayout},
}
</script>
<style scoped>
:deep(.ag-cell) {
  border-right: 1px solid #dde2eb;
}

:deep(.ag-header-cell) {
  border-right: 1px solid #dde2eb;
}

:deep(.ag-cell-value) {
  user-select: initial;
  -moz-user-select: text;
  -ms-user-select: text;
  -webkit-user-select: text;
}

.kkk {
  position: fixed;
  z-index: 99999999;
}

:deep(.arco-row-nowrap) {
  margin-top: 10px;
}

:deep(.kkk .arco-select-dropdown) {
  width: 500px !important;
}
</style>
